<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        li {
            list-style: none;
        }

        #tips {
            background-color: grey;
            line-height: 45px;
        }

        .list {
            padding: 10px 0;
            background-color: #f1f1f1;
            overflow: hidden;
        }

        .list li {
            height: 32px;
            line-height: 32px;
            border: 1px dashed #333;
        }

        .list .newLi {
            border-color: red;
        }

        .list .active {
            background-color: #6ff;
        }
    </style>
</head>

<body>
    <div class="wrap">
        <h3 id="tips">模拟封装jquery</h3>
        <div class="list">
            <li>01</li>
            <li>02</li>
            <li>03</li>
            <li>04</li>
            <li>05</li>
            <li>06</li>
        </div>
        <div class="box">
            <button class="setHtml">
                设置html
            </button>
            <button class="getHtml">
                获取html
            </button>
            <button class="setWidth">
                设置宽度
            </button>
            <button class="getWidth">
                获取宽度
            </button>
            <button class="hide">隐藏</button>
            <button class="show">显示</button>
            <button class="attr">attr</button>
            <button class="prop">prop</button>
            <button class="addClass">addClass</button>
            <button class="removeClass">removeClass</button>
            <button class="css">css</button>
            <button class="eq">第一个</button>
            <button class="siblings">siblings</button>
        </div>
    </div>
    <script src="./jquery-3.6.0.min.js"></script>
    <script>
        console.log();

        $(".list li").click(function () {
            $(this).addClass("active").siblings().removeClass("active")
        })

    </script>
</body>

</html>